% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fixcolnames2related.R
\name{fixcolnames2related}
\alias{fixcolnames2related}
\title{Get name of related avg, pctile, or ratio variable name}
\usage{
fixcolnames2related(
  namesnow,
  relatedtype = c("usavg", "stateavg", "uspctile", "statepctile", "usratio",
    "stateratio")
)
}
\arguments{
\item{namesnow}{vector of one or more basic Envt or Demog indicator variable names
found in c(names_e, names_d, names_d_subgroups)}

\item{relatedtype}{One of "usavg", "stateavg", "uspctile", "statepctile", "usratio", "stateratio"
(but not any of the other values among
unique(map_headernames$vartype) since those give ambiguous answers).}
}
\value{
vector as long as namesnow (or just returns namesnow if relatedtype is invalid)
}
\description{
Given names_d, e.g., returns names_d_ratio_to_state_avg
}
\details{
Given basic variable name(s) like "pctlowinc" or names_e,
see what the related variable names are for storing the
US or State percentiles, averages, or ratios to averages
of the given variables.

Only works for variable names among these:

c(names_e, names_d, names_d_subgroups)
}
\examples{
names_d
fixcolnames2related(names_d, 'stateratio')
names_d_ratio_to_state_avg
fixcolnames2related(names_e, "stateavg")
fixcolnames2related(names_e, "usvag")
paste0("avg.", names_e)
fixcolnames2related(names_e, "usratio")
# names_ej # does not work with this as input
# fixcolnames2related(names_ej, "uspctile") # does not return names_ej_pctile
  
}
\seealso{
\code{\link[=varinfo]{varinfo()}} \code{\link[=fixcolnames]{fixcolnames()}}
}
\keyword{internal}
